package com.terrynoya.fight.stateMachine.triggers
{
	import com.terrynoya.fight.char.Character;
	import com.terrynoya.fight.evaluation.Node;
	import com.terrynoya.fight.evaluation.ParseState;

	public class NumHelper
	{
		public function NumHelper()
		{
		}
		
		public static function eval(data:Object,node:Node):*
		{
			var chara:Character = Character(data);
			if(chara == null)
			{
				return 0;
			}
			var helperId:int = node.getChildAt(0).excute(data);
			var helperLen:int = chara.getHelperLength(helperId);
			return helperLen;
		}
		
		public static function parse(state:ParseState):Node
		{
			var node:Node = state.buildParenNumberNode(true);
			if(node != null)
			{
				return node;
			}
			else
			{
				return state.baseNode;
			}
		}
	}
}